extern queue waypt_head;
-static int duplicate_shortname = 0;
-static int duplicate_location = 0;
static char *snopt = NULL;
static char *lcopt = NULL;
{
queue * elem, * tmp;
waypoint * waypointp;
- btree_node * newnode, * btmp, * ftmp, * sup_tree = NULL;
+ btree_node * newnode, * btmp, * sup_tree = NULL;
unsigned long crc = 0;
struct { char shortname[32]; char lat[13]; char lon[13]; } dupe;
waypoint * delwpt = NULL;
memset(&dupe, '\0', sizeof(dupe));
- if (duplicate_shortname) {
+ if (snopt) {
strncpy(dupe.shortname, waypointp->shortname, sizeof(dupe.shortname) - 1);
}
- if (duplicate_location) {
+ if (lcopt) {
/* let sprintf take care of rounding */
sprintf(dupe.lat, "%11.6f", waypointp->position.latitude.degrees);
sprintf(dupe.lon, "%11.6f", waypointp->position.longitude.degrees);
void
duplicate_init(const char *args)
{
- duplicate_shortname = snopt != NULL;
- duplicate_location = lcopt != NULL;
}
void
disp_filter_vecs(void)
{
fl_vecs_t *vec;
+ arglist_t *ap;
+
for (vec = filter_vec_list; vec->vec; vec++) {
printf(" %-20.20s %-50.50s\n",
vec->name, vec->desc);
+ for (ap = vec->vec->args; ap && ap->argstring; ap++) {
+ printf(" %-18.18s %-.50s\n",
+ ap->argstring, ap->helpstring);
+ }
}
}
extern queue waypt_head;
static double pos_dist;
+static char *distopt;
+
+static
+arglist_t position_args[] = {
+ {"distance", &distopt, "Maximum positional distance (required)"},
+ {0, 0, 0}
+};
static double
gc_distance(double lat1, double lon1, double lat2, double lon2)
void
position_init(const char *args) {
char *fm;
- char *p;
- p = get_option(args, "distance");
+ pos_dist = 0;
- if (p) {
- pos_dist = strtod(p, &fm);
+ if (distopt) {
+ pos_dist = strtod(distopt, &fm);
if ((*fm == 'm') || (*fm == 'M')) {
/* distance is meters */
pos_dist *= 3.2802;
}
- xfree(p);
}
}
position_init,
position_process,
position_deinit,
- NULL
+ position_args
};